home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 51
/
Amiga Format CD51 (2000-03-10)(Future Publishing)(GB)[!][issue 2000-04].iso
/
-in_the_mag-
/
workbench
/
term_4.8
/
extras
/
source
/
gtlayout-source.lha
/
LTP_Delay.c
< prev
next >
Wrap
C/C++ Source or Header
|
1997-05-08
|
979b
|
48 lines
/*
** GadTools layout toolkit
**
** Copyright © 1993-1997 by Olaf `Olsen' Barthel
** Freely distributable.
**
** :ts=4
*/
#ifndef _GTLAYOUT_GLOBAL_H
#include "gtlayout_global.h"
#endif
#include "Assert.h"
VOID
LTP_Delay(ULONG Seconds,ULONG Micros)
{
struct MsgPort TimePort;
struct timerequest TimeRequest;
memset(&TimePort,0,sizeof(TimePort));
NewList(&TimePort.mp_MsgList);
TimePort.mp_Flags = PA_SIGNAL;
TimePort.mp_SigBit = SIGB_SINGLE;
TimePort.mp_SigTask = FindTask(NULL);
memset(&TimeRequest,0,sizeof(TimeRequest));
TimeRequest.tr_node.io_Message.mn_ReplyPort = &TimePort;
TimeRequest.tr_node.io_Message.mn_Length = sizeof(struct timerequest);
if(!OpenDevice(TIMERNAME,UNIT_VBLANK,&TimeRequest,NULL))
{
TimeRequest.tr_node.io_Command = TR_ADDREQUEST;
TimeRequest.tr_time.tv_secs = Seconds;
TimeRequest.tr_time.tv_micro = Micros;
SetSignal(0,SIGF_SINGLE);
SendIO(&TimeRequest);
WaitIO(&TimeRequest);
CloseDevice(&TimeRequest);
}
}